<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

	<head>
		<title>ajaxBridge example</title>
		<script type="text/javascript" src="http://o.aolcdn.com/dojo/1.0.0/dojo/dojo.xd.js"></script>
		<script type="text/javascript" src="../ajaxBridge.js"></script>
		<script type="text/javascript">

			// DHTML
			function set_box_value( value ) {
				document.getElementById('box').innerHTML = value;
			}

			// GET
			function test() {
				ajax_call( 'test', {load: function( ajax_response ) {
					set_box_value( ajax_response.value );
				}} );
			}

			// POST
			function form_test() {
				ajax_call_post( 'formular', 'form_test', {load: function( ajax_response ) {
					set_box_value( ajax_response.value );
				}} );
			}

		</script>
	</head>

	<body>
		<div id="box" name="box"
			style="
				width:200px;
				padding: 1em 0;
				background-color: lightblue;
				border:1px solid black;
				text-align:center;
			">
			-no value-
		</div>

		<h2>AJAX call via GET</h2>
		<button onclick="test();">Click mich!</button>

		<h2>AJAX call via POST</h2>
		<form id="formular"
			style="
				margin-top: 25px;
			">
			<label>Value: <input type="text" name="field" value="value" /></label><br />
			<button type="button" onclick="form_test();">Abschicken</button>
		</form>
	</body>

</html>